﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Rubik.Base;

namespace Rubik.Tester
{
    /// <summary>
    /// Represents Rubik's solution activator.
    /// </summary>
    public class RubikSolutionActivator
    {
        private readonly Type solutionType;

        /// <summary>
        /// Initializes a new instance of the <see cref="RubikSolutionActivator"/> class.
        /// </summary>
        /// <param name="solutionType">Type of the solution.</param>
        public RubikSolutionActivator(Type solutionType)
        {
            this.solutionType = solutionType;
        }

        /// <summary>
        /// Creaters an instance of the solution.
        /// </summary>
        /// <returns>The solution.</returns>
        public ICubeSerializer CreaterInstance()
        {
            return (ICubeSerializer)Activator.CreateInstance(solutionType);
        }
    }
}
